home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1995 November / EnigmA AMIGA RUN 02 (1995)(G.R. Edizioni)(IT)[!][issue 1995-11][Skylink CD].iso / earcd / docs / lwml9502.lha / Lightwave-Feb95 / 000538_owner-lightwave-l _Mon Feb 27 01:46:46 1995.msg < prev    next >
Internet Message Format  |  1995-03-19  |  11KB

  1. Return-Path: <owner-lightwave-l>
  2. Received: by mail4.netcom.com (8.6.9/Netcom)
  3.     id VAA10203; Wed, 22 Feb 1995 21:29:53 -0800
  4. Received: from zevs.ifi.unit.no by mail4.netcom.com (8.6.9/Netcom)
  5.     id VAA10100; Wed, 22 Feb 1995 21:29:19 -0800
  6. Received: from uranus.ifi.unit.no by zevs.ifi.unit.no with SMTP id AA26797
  7.   (5.67b/IDA-1.4.4 for <lightwave-l@netcom.com>); Thu, 23 Feb 1995 06:30:13 +0100
  8. Received: by uranus.ifi.unit.no (4.1/Uninett-C-1.4)
  9.     id AA03215; Thu, 23 Feb 95 06:30:11 +0100
  10. Date: Thu, 23 Feb 1995 06:30:10 +0100 (MET)
  11. From: Ole Andre Schistad <Ole.Andre.Schistad@ifi.unit.no>
  12. To: lightwave-l@netcom.com
  13. Subject: Open suggestion to NewTek regarding IK and general physics.
  14. Message-Id: <Pine.SUN.3.91.950222235020.18993A-100000@uranus.ifi.unit.no>
  15. Mime-Version: 1.0
  16. Content-Type: TEXT/PLAIN; charset=US-ASCII
  17. Sender: owner-lightwave-l@netcom.com
  18. Precedence: bulk
  19.  
  20.   The word on the grapevine is that the people at NewTek are open for 
  21. suggestions for LW4.0 , and that they read this list. In the hope of seeing
  22. at least some of the features I will mention here , I will try to throw all
  23. the suggestions I've been sitting with at you people :)
  24.  
  25.   I think everyone who use LW and/or the toaster will agree that there's really
  26. just one or two major features that are lacking ; namely procedural textures
  27. and some kind of kinematics. The former , I believe , will be achieved 
  28. through plug-in modules. (God , I hate that word , it's been a catch-phrase
  29. on everyone's lips ever since it became publicly known that LW4.0 would have
  30. them :-/ ). The latter , however , deserves integration into the main 
  31. interface. Now , before you all go ``Who needs all that fancy physics shit 
  32. in LW anyway ? That's real3d V2 territory , and you know it!'' I want you 
  33. to consider just what the lack of physics of any kind means.
  34.  
  35.   The human being has an amazing ability to do trajectory calculations by
  36. intuition .This is no wonder , as we've been throwing things around for 
  37. thousands of years. When you pick up a stone and throw it at a lightpost ,
  38. you never consider gravity and weight consciously, and yet you still hit it. 
  39. A good pitcher can place a throw within an inch from where he's aiming,
  40. and even more amazingly , a good batter actually HITS that screaming 70+ mps
  41. blur of motion. Tough shit, you say , can I finish my render now please ?
  42.  
  43.   So what IS that animation anyway ? Is it a work of art , or just an attempt
  44. to recreate a small piece of reality ? I believe it's both. More than
  45. anything , though , we are making ILLUSIONS.. and as any good magician 
  46. could tell you , an illusion must be credible to work. But if your objects 
  47. are doing things that simply aren't possible in our world, the watcher 
  48. balks.. the illusion is broken and (s)he realizes that it was all just 
  49. special effects .. make believe .. lies. A good animator avoids that 
  50. pitfall, but it almost always takes a lot of tweaking. I'm sure you know
  51. the feeling .. ``How DOES it move anyway ? THAT sure as hell didn't look 
  52. right!'' . 
  53.  
  54.   Which brings me back to the central issue : An intuitive and easy way to
  55. animate the way nature does. This is also where I will start getting 
  56. technical so please bear with me.
  57.  
  58.   The first thing I learned as a physics student was simplification. By
  59. themselves , the rules that govern our universe are so complex that a mere
  60. human could not hope to take them all into consideration.. even newtonian
  61. physics is enough to drive you out of your mind if you have to consider 
  62. all the equations at once. What you do instead is to look at the cases 
  63. separately , and as simplified as you can possibly get them. It all boils 
  64. down to a set of forces that act upon an object (or body) . Each of those 
  65. forces act in ONE direction each . When you know all the forces that act 
  66. on a body , you can further narrow everything down to one single force acting
  67. upon your object ; a force whose value and direction can be regarded as a 
  68. vector.
  69.  
  70.   To illustrate my point , let's say you have two planets orbiting the sun.
  71. You know that all of those three bodies affect each other with a 
  72. gravitational force that's inversely proportional to their relative distance
  73. from each other (F = gamma * Mm/dd , where gamma is the gravitational 
  74. constant ) . In addition , you have the force that keeps the planets from
  75. falling into the sun ; this is the (rather incorrectly named) centrifugal
  76. force ( F = vv/d ; velocity by the power of two , divided by distance)
  77. So you have four vectors that apply to each of your planets ; current
  78. movement (that is , speed and direction) , gravity from the sun , gravity
  79. from your other planet , and inertia (centrifugal force). 
  80.                       4
  81.                      '`  planet
  82.   ___                || /
  83.  /   \               ||/
  84. | sun |       1 <====()====>2
  85.  \___/               ||
  86.                      `'
  87.                       3
  88.  
  89.  
  90.  
  91.  
  92.  
  93.                      ()-- Planet 2
  94.  
  95.  
  96. Okay , so let's consider the equation in two dimentions ..
  97. You have the vector-set [-3,0] , [3,0] , [0,-1] and [0,25] (vector 4 is the 
  98. planets speed , which is not a force.) You want those three forces 
  99. simplified into one , so you add them together :
  100.  
  101. [-3+3+0 , 0+0-1] = [0,-1] ; voila! you have your single vector that sums
  102.                             up all the forces acting on the planet . 
  103.  
  104.  
  105.   Now let's go one step further ; suppose we know that force .. how does it
  106. affect our object ? All objects have a mass , or more generally , a mass 
  107. distribution . Actually , mass is never distributed uniformly , but 
  108. rather as a random variation in density that usually sticks close enough
  109. to a normalized `mass-per-volume' that we can regard it as uniform.
  110.  
  111.   The beauty of it all though is that for all practical purposes
  112. you can regard that mass as centered at one point; the center of mass. 
  113. And when you know an objects center of mass , you can very easily calculate
  114. how an object is affected by a given force , *including its rotation* !
  115.  
  116.   Attracting and repulsing forces act on the center of mass directly , and 
  117. generate a change in direction and speed . Things get slightly more 
  118. complicated when you're dealing with collisions , because the forces 
  119. involved no longer act on the center directly ; they act where two bodies
  120. intersect. (No pun intended , a body is per definition an object that has 
  121. mass and size larger than zero :-)) . The big secret is ; where did the 
  122. bodies intersect ? When you know that , you're home free - almost.
  123.   
  124.  
  125. __________________________  This is how it looks when you consider just
  126. |                        |  one of the bodies ; X marks the center of mass,
  127. |            X           |  and I is the force that's affecting it. 
  128. |                        |  
  129. |________________________|<====
  130.                              I
  131.  
  132.  
  133. (What I've tried to draw here is an off-center impulse)
  134.  
  135. In order to calculate the change in rotation and velocity , you draw
  136. a line from X to the intersection point. Find the angle between that line 
  137. and vector I , find the components in all three dimentions , and you know
  138. how the body will move. I would give the equations , only it's been three
  139. years since I left my physics studies , and the only physics book I was able
  140. to dig up was modern physics (no need to get Eisteinian yet :-) - rather 
  141. embarrassing really :( . The calculations should take FAR less than a second
  142. on any machine quipped with an FPU. 
  143.  
  144.   So far so good. None of this should be new to Allen and the other people 
  145. at NewTek. The big question is that of the implementation , and I tell 
  146. thee straight ; stick that center of mass into your object format , and 
  147. the job is already half done! :) What I have in mind is to keep the heavy
  148. calculations where they belong ; in modeler. Let's presume that the world is
  149. perfect , and that all objects have a uniform distribution . Calculate
  150. the geometric center of an object , and you get the center of mass. 
  151. That's the only really heavy equation you need , the rest can be done almost
  152. real-time in layout. 
  153.  
  154.  
  155.   What we want from a `physics' addition to LW is the POSSIBILITY to add
  156. real-life motion to our objects , not the necessity to take it into 
  157. consideration. This means that there must be a way to turn physics off,
  158. and leave everything in the capable hands of the user.
  159.  
  160.   Also , the concept of `force' does not exist in LW at this point , but 
  161. you can use Newtons 2nd law ( F=ma ) since you always know the velocity of an
  162. object.  What I have in mind is to separate objects into two or three 
  163. cathegories. I believe the best way to handle the concept of force is to let 
  164. all forces originate in objects or null-objects. Once an object is set up as 
  165. an originator of force (Simple button+value in the objects menu)
  166. it can either  default to receiving forces from other objects , or you 
  167. can totally abstract by leaving that too up to the user. All other objects are
  168. unaffected by force , and I don't think I need to explain why.
  169.  
  170.   A more crucial consideration is that of collision detection , as it could 
  171. potentially wreak havoc on layout . Again , I do not think it would be a
  172. good idea that all objects are taken into account when you want to check for
  173. collisions , because when polygon count goes into the thousands it would
  174. take forever if you had to check for collision against all of them. 
  175.  
  176.   The best approach would perhaps be to limit collision detection to  
  177. `physically receptive' objects (that little button in the objects menu  :).
  178. Whenever the user moves a receptor , you check for collision detection 
  179. along the path from the last known position , and if one has occurred you 
  180. can prompt the user with a simple yes/no requester asking wether or not to
  181. calculate new trajectories . This means that while physics are turned on and 
  182. the user is manipulating a `receptive' object , he is giving trajectory 
  183. input , not absolute positions . (`I want this object to move along a path 
  184. that would take it to this point unless it hits something else'). You 
  185. could even keep the physics on a frame-by-frame basis and keep velocity 
  186. vectors constant after physics are turned off. 
  187.  
  188.   As an alternative to collision detection , you could let the user target
  189. two or more objects together as `physically interactive' . Whenever one 
  190. object is moved , the other connected objects are moved and rotated based
  191. on how their respective centers of mass are located in relation to an
  192. anchor point . I haven't worked out quite how this should work , as
  193. I regard collision detection as instrumental if you want any kind of 
  194. realistic behaviour.
  195.  
  196.  
  197. And that concludes this rather lengthy mail :)
  198.  
  199. - Ole Andre Schistad